<template>
   <deptUserTree :departId="0" :type="'user'" :multiple="false" @save="treeNextSave" :filterOrgIds="['3601001001','3601001002','3601001003']"></deptUserTree>
</template>
<script>

export default {
  props: {
    // 流程变量
    variable: {
      typeof: String,
      require: true,
    },
  },
  data() {
    return {
    }
  },
  created() {},
  methods: {
    // 下一步树保存
    treeNextSave(obj) {
      console.log('obj', obj)
      let userid = null;
      if (obj.id) {
        userid = obj.id.substr(obj.id.indexOf('_') + 1)
      } else {
        userid = ''
      }
      this.$emit('f_setVariable', this.variable, userid)
      // if (obj.name) {
      //   this.nextUsername = obj.name.substr(obj.id.indexOf('_') + 1)
      // } else {
      //   this.nextUsername = ''
      // }
    },
  },
  components: {
    deptUserTree: () => import('@/views/base/DeptUserTree.vue')
  }
}
</script>

<style lang="scss" scoped>

</style>
